package com.springinaction.springidol2;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 注解可以在任何set方法上面,可以在构造器上,在任意方法上
 * @author xupeng
 *
 */
@Component
public class Instrumentalist2 implements Performer2 {
	
	@Autowired
	private Instrument2 instrument;
	
	public Instrument2 getInstrument() {
		return instrument;
	}

	@Override
	public void perform() throws PerformanceException2 {
		System.out.println("Instrumentalist2 Instrumentalist2 Instrumentalist2");
		instrument.play();
	}

}
